<?php
require 'class.filefromdb.php';
require 'pdo.php';
$message = null;
if (isset($_FILES['myFile'])) {
	$File = new FileFromDB($_FILES['myFile']['name']);
	$File->upload($_FILES['myFile']);
	$message = 'Votre fichier à bien été ajouté';
}
?>
<html lang="fr">
	<head>
		<meta charset="utf-8">
		<meta http-equiv="Content-Language" content="fr"/>
		<title>Page de test</title>
		<link rel="stylesheet" href="style.css" />
	</head>

	<body>
		<form method="post" enctype="multipart/form-data">
			<?php echo $message; ?>
			<fieldset>
				<legend>Charger un fichier</legend>
				<p>
					<label for="myFile">Fichier</label>
					<input type="file" id="myFile" name="myFile" />
				</p>
				<p>
					<input type="reset" value="Annuler" />
					<input type="submit" value="Envoyer" />
				</p>
			</fieldset>
		</form>
	</body>
</html>